<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateMessagesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('messages', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('senderid')->index('senderid');
			$table->integer('receiverid')->index('receiverid');
			$table->string('content', 8192);
			$table->timestamps();
			$table->integer('delete')->default(0);
		});
        DB::update('ALTER TABLE messages AUTO_INCREMENT = 30390');
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('messages');
	}

}
